﻿using System;

namespace Mbs.Messaging
{
    [Serializable]
    public class MessageListner : MarshalByRefObject, ISimpleMessageListner
    {
        public MessageListner() : this(MessageListnerType.None) { }
        public MessageListner(MessageListnerType hookType)
        {
            this.Type = hookType;
        }

        public virtual MessageListnerType Type { get; set; }

        public virtual void OnObserverAdding(object observer, string topic, Type messageType) { }
        public virtual void OnObserverRemoving(object observer, string topic, Type messageType) { }
        public virtual void OnObserverAdded(object observer, string topic, Type messageType) { }
        public virtual void OnObserverRemoved(object observer, string topic, Type messageType) { }

        public virtual void OnPreFilterAdding(object observer, string topic, Type messageType) { }
        public virtual void OnPreFilterRemoving(object observer, string topic, Type messageType) { }
        public virtual void OnPreFilterAdded(object observer, string topic, Type messageType) { }
        public virtual void OnPreFilterRemoved(object observer, string topic, Type messageType) { }

        public virtual void OnFilterAdding(object observer, string topic, Type messageType) { }
        public virtual void OnFilterRemoving(object observer, string topic, Type messageType) { }
        public virtual void OnFilterAdded(object observer, string topic, Type messageType) { }
        public virtual void OnFilterRemoved(object observer, string topic, Type messageType) { }


        public virtual void OnSending(object sender, SendingEventArgs e) { }
        public virtual void OnSent(object sender, MessageEventArgs e) { }

        public virtual void OnReceivingException(object sender, ReceivingExceptionEventArgs e) { }
        public virtual void OnReceiving(object sender, ReceivingEventArgs e) { }
        public virtual void OnReceived(object sender, MessageEventArgs e) { }

        public virtual void Dispose() { }
    }
}
